<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>创建新元素</title>
</head>
<body>
<script>
    var newDiv = document.createElement("div");
    var newText = document.createTextNode("Hello World!");
    newDiv.appendChild(newText);
    document.body.appendChild(newDiv);
</script>
</body>
</html>